package com.study.mike.MainTtry;

/**
 * 爬楼体
 *
 * @author KangHui
 * @Date 2022/7/8 9:55
 */
public class Climb {
    public static void main(String[] args) {
        int sumClimb = Climb.sumClimb(120);
        System.out.println(sumClimb);
    }

    public static int sumClimb(int number) {
        int num1 = 1;
        int num2 = 2;
        int numSum = 0;
        if (number == 1) {
            return 1;
        }
        if (number == 2) {
            return 2;
        }
        for (int i = 3; i <= number; i++) {
            numSum = num1 + num2;
            num1 = num2;
            num2 = numSum;
        }
        return numSum;
    }
}
